<!DOCTYPE html>
<html>
<head>
    <title>设备报警记录</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div>
        <table id="jqGrid"></table>
    </div>
</div>
<script>
    var alarmCode = getQueryString('alarmCode');
    var devId = getQueryString('devId');
    $(function () {
        $("#jqGrid").Grid({
            url: '../devalarmrecord/list?alarmCode=' + alarmCode + '&devId=' + devId,
            multiselect: false,
            colModel: [
                // {label: '报警码', name: 'alarmtype', index: 'CODE', width: 60,
                //     formatter: function (value, col, row) {
                //         return sysEnums.ALARM_TYPE[value];
                //     }
                // },
                {label: '报警码', name: 'alarmCode', index: 'CODE', width: 60},
                {label: '报警信息', name: 'alarmMsg', index: 'MSG', width: 180},
                {label: '开始时间', name: 'startTime', index: 'START_TIME',
                    formatter:function(value, options, row){
                        return transDate(value, "yyyy-MM-dd hh:mm:ss");
                    }
                },
                {label: '结束时间', name: 'endTime', index: 'END_TIME',
                    formatter:function(value, options, row){
                        return transDate(value, "yyyy-MM-dd hh:mm:ss");
                    }
                },
                {label: 'id', index: 'ID', key: true, hidden: true},
            ]
        });
    });

    let vm = new Vue({
        el: '#rrapp',
        data: {
        },
        methods: {
            query: function () {
                vm.reload();
            },
            reload: function (event) {
                vm.showList = true;
                let page = $("#jqGrid").jqGrid('getGridParam', 'page');
                $("#jqGrid").jqGrid('setGridParam', {
                    postData: {'name': ''},
                    page: page
                }).trigger("reloadGrid");
            }
        }
    });
</script>
</body>
</html>
